﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EasyPiano
{
    public partial class KeyboardControl : UserControl
    {
        public KeyboardControl()
        {
            InitializeComponent();
        }
        public void ShowTheme1()
        {
            foreach (KeyControl keyControl in this.Controls)
            {
                keyControl.ShowKeyStr();
            }
        }
        public void ShowTheme2()
        {
            foreach (KeyControl keyControl in this.Controls)
            {
                keyControl.ShowSoundStr();
            }
        }

        /// <summary>
        /// 重写系统Key处理事件
        /// </summary>
        /// <param name="keyData"></param>
        /// <returns></returns>
        protected override bool ProcessDialogKey(Keys keyData)
        {

            if (keyData == Keys.Up || keyData == Keys.Down ||
                keyData == Keys.Left || keyData == Keys.Right ||
                keyData == Keys.Shift || keyData == Keys.Tab)
            {
                return false;
            }
            else
            {
                return base.ProcessDialogKey(keyData);
            }
        }
    }
}
